﻿using System;
using System.Collections.Generic;
using System.Text;
using Estimate.Common.DataFileFinder;
using Estimate.Common.DataImporter;
using System.Configuration;
using System.IO;
using Estimate.Common.Estimate;
using Estimate.Common.Entity;
using Estimate.Common.DBFieldTypes;
using Estimate.Common.Repository;
using Estimate.Common;
using Estimate.Reports;
using log4net;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace BuildData
{
    class Program
    {
        static void Main(string[] args)
        {

            ILog Logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            DataImporterCombiner combiner = new DataImporterCombiner(ConfigurationManager.AppSettings);

            try
            {
                Console.WriteLine();
                Console.WriteLine("===================={0}===================", "正在生成系统首页报表数据");
                //导入首页报表数据
                AutoImportHomeReportData ImportHomeReportData = new AutoImportHomeReportData(ConfigurationManager.AppSettings["ConnectionString"]);
                ImportHomeReportData.AddHomeReportData();
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }

            try
            {
                Console.WriteLine();
                Console.WriteLine("===================={0}===================", "正在生成省台预报员排名数据");
                //导入省台预报员排名数据
                AutoImportStForeRankReportData ImportStForeRankReportData = new AutoImportStForeRankReportData(ConfigurationManager.AppSettings["ConnectionString"]);
               
                ImportStForeRankReportData.AddStForeRankReportData();
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }

            try
            {
                Console.WriteLine();
                Console.WriteLine("===================={0}===================", "正在生成预报员排名数据");
                //导入预报员排名数据
                AutoImportIndividualRankReportData ImportIndividualRankReportData = new AutoImportIndividualRankReportData(ConfigurationManager.AppSettings["ConnectionString"]);

                ImportIndividualRankReportData.AddIndividualRankReportData();
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }

            try
            {
                Console.WriteLine();
                Console.WriteLine("===================={0}===================", "正在生成常用报表数据");
               
                AutoImporttUsuallyReportData ImportUsuallyReportData = new AutoImporttUsuallyReportData(ConfigurationManager.AppSettings["ConnectionString"]);

                ImportUsuallyReportData.AddUsuallyReportData();
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }

            try
            {
                Console.WriteLine();
                Console.WriteLine("===================={0}===================", "正在生成核查表数据");

                AutoImportZytHandinReportData ImportZytHandinReportData = new AutoImportZytHandinReportData(ConfigurationManager.AppSettings["ConnectionString"]);

                ImportZytHandinReportData.AddZytHandinReportData();
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }

        }
    }
}
